﻿@page "/signatures"
@inherits PageBase

<PageContainer>
    <Breadcrumb>
        <Breadcrumb>
            <BreadcrumbItem><Icon Type="home"></Icon></BreadcrumbItem>
            <BreadcrumbItem><Icon Type="thunderbolt"></Icon><span>个性签名</span></BreadcrumbItem>
        </Breadcrumb>
    </Breadcrumb>
    <ChildContent>
        <Card>
            <Table TItem="SignatureDto"
                   DataSource="@signatures"
                   Bordered=@true
                   Size=@TableSize.Small
                   Total="total"
                   @bind-PageIndex="page"
                   @bind-PageSize="limit"
                   OnPageIndexChange="HandlePageIndexChange">
                <Column @bind-Field="@context.Id" Title="Id" Sortable="false"></Column>
                <Column @bind-Field="@context.Name" Title="姓名" Sortable="false"></Column>
                <Column @bind-Field="@context.Type" Title="类型" Sortable="false"></Column>
                <Column @bind-Field="@context.Url" Title="链接" Sortable="false">
                    <a target="_blank" href="https://static.meowv.com/signature/@context.Url">@context.Url</a>
                </Column>
                <Column @bind-Field="@context.Ip" Title="IP地址" Sortable="false"></Column>
                <Column @bind-Field="@context.CreatedAt" Title="创建时间" Sortable="false"></Column>
                <ActionColumn Title="操作">
                    <Space Size="@("small")">
                        <SpaceItem>
                            <Popconfirm Title="确定删除吗?"
                                        Icon="close-circle"
                                        OnConfirm="(async () => await DeleteAsync(context.Id))">
                                <Button Danger>删除</Button>
                            </Popconfirm>
                        </SpaceItem>
                    </Space>
                </ActionColumn>
            </Table>
        </Card>
    </ChildContent>
</PageContainer>